<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenShoe: OpenShoe filtering algorithms</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenShoe
   &#160;<span id="projectnumber">1.0</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#groups">Modules</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">OpenShoe filtering algorithms</div>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="groups"></a>
Modules</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__aux__func.html">Auxilliary functions</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>Auxilliary functions for calculation various matrix and scalar operations. </p>
<br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__miscel.html">Miscellaneous</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>Miscellaneous routines. </p>
<br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__main__func.html">ZUPT aided INS functions</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>the main functions for running the ZUPT aided INS. </p>
<br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html">Initialization routines</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>Routines for initializing the system. Only coarse initial alignment is implemented. </p>
<br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__calib.html">Calibration routines</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>Calibration routines. Only accelerometer calibration is implemented since basic gyro calibration (bias) is trivial and is available on the IMU. </p>
<br/></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gac33a980808c64969262d91fa090eae7d">MAX_ORIENTATIONS</a>&#160;&#160;&#160;12</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum numbers of orientations that can be used in the accelerometer calibration.  <a href="#gac33a980808c64969262d91fa090eae7d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga4a21daf1ec76403dafe6b89d46fedbce">MIN_ORIENTATIONS</a>&#160;&#160;&#160;3</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Minimum numbers of orientations that can be used in the accelerometer calibration.  <a href="#ga4a21daf1ec76403dafe6b89d46fedbce"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga2543e63d374d215bd7e64b4afb54287f">MATRIX_INVERSION_ERROR</a>&#160;&#160;&#160;1</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Value returned in the error message if an error occurred in the matrix inversion.  <a href="#ga2543e63d374d215bd7e64b4afb54287f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gad356bf235d99e4983077623c35c068c0">ACC_STATIONARITY_ERROR</a>&#160;&#160;&#160;2</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Value returned in the error message if the IMU was not stationary during the accelerometer calibration.  <a href="#gad356bf235d99e4983077623c35c068c0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga831d1c30dc8456f94b32e61f65409f4d">ACC_CALIBRATION_ILLCONDITIONED</a>&#160;&#160;&#160;3</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Value returned in the error message if the orientations used in the accelerometer calibration were poorly chosen.  <a href="#ga831d1c30dc8456f94b32e61f65409f4d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gae34482207df685c69af65539f47656fa">NUMBER_OF_ORIENTATIONS_TO_LARGE</a>&#160;&#160;&#160;4</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Value returned in the error message if the number of orientations specified for the accelerometer calibration is to large. It has been changed to 12.  <a href="#gae34482207df685c69af65539f47656fa"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gad656aa8d45ef9064bf607734a3af16a1">NUMBER_OF_ORIENTATIONS_TO_SMALL</a>&#160;&#160;&#160;5</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Value returned in the error message if the number of orientations specified for the accelerometer calibration is to few. It has been changed to 3.  <a href="#gad656aa8d45ef9064bf607734a3af16a1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga8add91659e5cb9c98d3a32c44269f034">absf</a>(a)&#160;&#160;&#160;(a&gt;0 ? a:-a)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Absolute value of a floating point variable.  <a href="#ga8add91659e5cb9c98d3a32c44269f034"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gabb3f28a44a35898c77d789734914c4c2">calibrate_accelerometers</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for calibrating the accelerometer biases.  <a href="#gabb3f28a44a35898c77d789734914c4c2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga272f4012a72ac416888be28bff0236e6">estimate_accelerometer_biases</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Function that estimates the accelerometer biases given a matrix of the mean of the measured acceleration at different orientations.  <a href="#ga272f4012a72ac416888be28bff0236e6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga8812381ada5c2786a10e378e4ca34377">correct_navigation_states</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for correcting the navigation states given a zero-velocity detection.  <a href="#ga8812381ada5c2786a10e378e4ca34377"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga75c4a936b2db01f930ba89babb822f69">gain_matrix</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for calculating the Kalman filter gain matrix.  <a href="#ga75c4a936b2db01f930ba89babb822f69"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga8b0f8dc8c2ae1ff3f5e4f27284cf8e77">initialize_navigation_algorithm</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for initializing the navigation algorithm.  <a href="#ga8b0f8dc8c2ae1ff3f5e4f27284cf8e77"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gaa1673f6cf928e97c6372c56eddb4cc72">measurement_update</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for doing a measurement update of the Kalman filter covariance.  <a href="#gaa1673f6cf928e97c6372c56eddb4cc72"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga9169808fbcb9f517deb908960a69ca7a">strapdown_mechanisation_equations</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for doing a time update of the mechanized navigation equations.  <a href="#ga9169808fbcb9f517deb908960a69ca7a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gac80ad2aa648edb47edb8f62883cb2a7d">time_up_data</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for doing a time update of the Kalman filter state covariance.  <a href="#gac80ad2aa648edb47edb8f62883cb2a7d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gaae1bbd924940610e1709300d40ca5a0f">update_imu_data_buffers</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Function that updates the IMU data buffers with the latest values read from the IMU, and writes the IMU data to that should be process at the current iteration to the processing variables.  <a href="#gaae1bbd924940610e1709300d40ca5a0f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gaf0b7424f50d37755b6b0736808082299">ZUPT_detector</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for detecting when the system has zero-velocity.  <a href="#gaf0b7424f50d37755b6b0736808082299"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga0b4ee34435eebb426eb367120ee79d72">zupt_update</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Wrapper function that checks if a zero-velocity update should be done, and then calls all navigation algorithm functions that should be executed during a zero-velocity update.  <a href="#ga0b4ee34435eebb426eb367120ee79d72"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Accelerometer calibration parameters.</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrp498a39b5e61b8b18fd67982a4b1746b8"></a> Parameters controlling accelerometer calibration, and vectors and matrices used store the biases. </p>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga1089eea940f41eff26a6cba1172089e9">accelerometer_biases</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Accelerometer biases (x,y,z-axis) [ <img class="formulaInl" alt="$m/s^2$" src="form_17.png"/>].  <a href="#ga1089eea940f41eff26a6cba1172089e9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gad5049be4d6ed3b9f92063c6ca6413b46">acceleration_variance_threshold</a> = 0.002</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Threshold used to check that accelerometers were stationary during the calibration [ <img class="formulaInl" alt="$(m/s^2)^2$" src="form_18.png"/>].  <a href="#gad5049be4d6ed3b9f92063c6ca6413b46"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gab9d05ce5927a225127eff6993856da19">nr_of_calibration_samples</a> = 800</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of samples used at each orientation in the calibration procedure.  <a href="#gab9d05ce5927a225127eff6993856da19"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga642a3ad33a0242f4e12fe46a13b0303f">nr_of_calibration_orientations</a> = 6</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of orientations used in the accelerometer calibration procedure. OBS! Most be at least 3 and less than 13.  <a href="#ga642a3ad33a0242f4e12fe46a13b0303f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga9340627920ea2445fe1469547bc64eae">new_orientation_flag</a> = false</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Flag that is set to true when the IMU should be place in a new orientation. Should be set to false when the calibration procedure is started, and when the IMU has been placed in a new orientation by the user.  <a href="#ga9340627920ea2445fe1469547bc64eae"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gaa3b35b0b909a9a4b40d82658fab54349">acc_calibration_finished_flag</a> = false</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Flag that is set to true when the calibration is finished. Must be set to false before the calibration is started.  <a href="#gaa3b35b0b909a9a4b40d82658fab54349"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
General control parameters.</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrp043d227d7d75d0dd1cb5b6e51032aaac"></a> Parameters controlling general settings of the navigation algorithm </p>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga98eaf96c6c207db4b40273a599149ebe">latitude</a> = 13</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Rough latitude of the system [ <img class="formulaInl" alt="$degrees$" src="form_19.png"/>]. (Used to calculate the magnitude of the gravity vector)  <a href="#ga98eaf96c6c207db4b40273a599149ebe"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga0387cded24d9bdfa34c78dc27bef01e8">altitude</a> = 920</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Rough altitude of the system [ <img class="formulaInl" alt="$m$" src="form_20.png"/>]. (Used to calculate the magnitude of the gravity vector)  <a href="#ga0387cded24d9bdfa34c78dc27bef01e8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gac7d75e5db7af21a75e50ad6437827947">g</a> = 9.782940329221166</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Magnitude of the local gravity acceleration [ <img class="formulaInl" alt="$m/s^2$" src="form_17.png"/>].  <a href="#gac7d75e5db7af21a75e50ad6437827947"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gae7e97f885bb0d70931c5c70ad200880d">dt</a> = 0.001220703125000</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sampling period [ <img class="formulaInl" alt="$s$" src="form_21.png"/>].  <a href="#gae7e97f885bb0d70931c5c70ad200880d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga3f996476795917a4b1ace8c6c5e4b28a">error_signal</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Error signaling vector. If zero no error has occurred.  <a href="#ga3f996476795917a4b1ace8c6c5e4b28a"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
IMU data buffer variables.</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrpc25420e6089685cb041e1744e731c61a"></a> Vectors and variables related to the IMU data buffer. </p>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gaf92cab44915b7d9faaf5aeadb328bae6">accelerations_in</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Accelerations read from the IMU [ <img class="formulaInl" alt="$m/s^2$" src="form_17.png"/>]. These are written into the IMU data buffer.  <a href="#gaf92cab44915b7d9faaf5aeadb328bae6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga8cac4b2812dcb492989d7122c5eb0bfb">angular_rates_in</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Angular rates read from the IMU [ <img class="formulaInl" alt="$rad/s$" src="form_22.png"/>]. These are written into the IMU data buffer.  <a href="#ga8cac4b2812dcb492989d7122c5eb0bfb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga0e1577a397995052e34d61ddbf578956">accelerations_out</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Accelerations outputted from the IMU data buffer [ <img class="formulaInl" alt="$m/s^2$" src="form_17.png"/>].  <a href="#ga0e1577a397995052e34d61ddbf578956"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gabdb2113f7c6caefe1b25826c1f7c8324">angular_rates_out</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Angular rates outputted from the IMU data buffer [ <img class="formulaInl" alt="$rad/s$" src="form_22.png"/>].  <a href="#gabdb2113f7c6caefe1b25826c1f7c8324"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Initialization control parameters</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrpa118b835fc84476bcd7bcacc21f1e294"></a> Parameters controlling the initialization of the navigation algorithm, i.e., the initial states of the inertial navigation system equations and the initial Kalman filter covariance matrix. </p>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gac64a954fe1bf13df62e1e96920a36035">initialize_flag</a> = true</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A flag that should be set to true when initialization is started and that becomes false when the initialization is finished.  <a href="#gac64a954fe1bf13df62e1e96920a36035"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gaf3c89a8b1365434986dc0314c1c541cf">nr_of_inital_alignment_samples</a> = 16</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of samples used in the initial alignment.  <a href="#gaf3c89a8b1365434986dc0314c1c541cf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gaf18deb1376fcc761f2ec2d947cf004e7">initial_heading</a> = 0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initial heading [ <img class="formulaInl" alt="$rad$" src="form_23.png"/>].  <a href="#gaf18deb1376fcc761f2ec2d947cf004e7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga7cd4f9c9472377e6ef5935727ada7109">initial_pos</a> = {0, 0, 0}</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initial position (North, East, Down) [ <img class="formulaInl" alt="$m$" src="form_20.png"/>].  <a href="#ga7cd4f9c9472377e6ef5935727ada7109"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga0ace968269836475a5c59c16280d1bf1">sigma_initial_position</a> = {0.00001,0.00001,0.00001}</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Standard deviations in the initial position uncertainties [ <img class="formulaInl" alt="$m$" src="form_20.png"/>].  <a href="#ga0ace968269836475a5c59c16280d1bf1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga5abe69320e5702cb7f4b79abb9bcf297">sigma_initial_velocity</a> = {0.01,0.01,0.01}</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Standard deviations in the initial velocity uncertainties [ <img class="formulaInl" alt="$m/s$" src="form_24.png"/>].  <a href="#ga5abe69320e5702cb7f4b79abb9bcf297"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gaad9757cf97cfd938818e7785a3beafe1">sigma_initial_attitude</a> = {0.00174,0.00174,0.00174}</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Standard deviations in the initial attitude uncertainties [ <img class="formulaInl" alt="$rad$" src="form_23.png"/>].  <a href="#gaad9757cf97cfd938818e7785a3beafe1"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Kalman filter control parameters</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrp5a5d8141c51eafd0fafa7b9cf62a2515"></a> Parameters controlling the behavior of the Kalman filter. The parameters can be changed while the filter is running to adapt the filter to the current motion dynamics.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>The default noise standard deviation figures are not set to reflect the true noise figures of the IMU sensors, but rather to model the sum of all the errors (biases, scale factors, nonlinearities, etc.) in the system and the measurement model. </dd></dl>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga5add0877d1169e9e1d4dd227c1bcc83d">sigma_acceleration</a> = 0.7</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Accelerometer process noise standard deviation [ <img class="formulaInl" alt="$m/s^2$" src="form_17.png"/>].  <a href="#ga5add0877d1169e9e1d4dd227c1bcc83d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gab6e7cd8a13de230fbcef8ad4e8001eb6">sigma_gyroscope</a> = 0.005235987755983</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gyroscope process noise standard deviation [ <img class="formulaInl" alt="$rad/s$" src="form_22.png"/>].  <a href="#gab6e7cd8a13de230fbcef8ad4e8001eb6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gae79b582d3d0132b84117242e1f6103f3">sigma_velocity</a> = {0.1,0.1,0.1}</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pseudo zero-velocity measurement noise standard deviations (north, east, down) [ <img class="formulaInl" alt="$m/s$" src="form_24.png"/>].  <a href="#gae79b582d3d0132b84117242e1f6103f3"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Navigation and filter state variables.</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrp0f8fa76f99fe991372a251de33492bc0"></a> Vectors that holds the current navigation state estimate and the covariance and gain of the Kalman filter. </p>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga2807b9fb4b79e01dfde022b613d2575f">position</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Position estimate (North,East,Down) [ <img class="formulaInl" alt="$m$" src="form_20.png"/>].  <a href="#ga2807b9fb4b79e01dfde022b613d2575f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga589efe00d8bd4e8a69613f98390a04c7">velocity</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Velocity estimate (North,East,Down) [ <img class="formulaInl" alt="$m/s$" src="form_24.png"/>].  <a href="#ga589efe00d8bd4e8a69613f98390a04c7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#ad9a64f455fa02affaba6740746aae7b2">quat_vec</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga059b83d370e7e6a5e9728a8f91943051">quaternions</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Attitude (quaternions) estimate.  <a href="#ga059b83d370e7e6a5e9728a8f91943051"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#ab7675278cb555aa98b43c97694753329">mat3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga42753cbc9ae76483da3cbc331a011586">Rb2t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Rotation matrix used as an "aiding" variable in the filter algorithm. Holds the same information as the quaternions.  <a href="#ga42753cbc9ae76483da3cbc331a011586"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a0f4089eb3ad75e0675d7f7d3914fddeb">mat9sym</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga74c09cdfc5b901e7f842dbe42ed8f4f4">cov_vector</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Vector representation of the Kalman filter covariance matrix.  <a href="#ga74c09cdfc5b901e7f842dbe42ed8f4f4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#af1d09a15760e21f5de26f0839f1b6c62">mat9by3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gac1df051c6f380aa8d1598b15ee9e6eca">kalman_gain</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Vector representation of the Kalman filter gain matrix.  <a href="#gac1df051c6f380aa8d1598b15ee9e6eca"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Zero-velocity detector control parameters</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrp9b098e683e94baa665e2c2dccf093fdc"></a> Parameters controlling the behavior of the zero-velocity detector. All the detector control parameters, except the <em>detector_Window_size</em> may be changed will the navigation algorithm is running in order to adapt the behavior of the detector to the current motion dynamics. </p>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga519e1c68258a371960249e09c24e9943">sigma_acc_det</a> = 0.035</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Accelerometer noise standard deviation figure [ <img class="formulaInl" alt="$m/s^2$" src="form_17.png"/>], which is used to control how much the detector should trusts the accelerometer data.  <a href="#ga519e1c68258a371960249e09c24e9943"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga779a972b079accc690d64bcd7bef3c91">sigma_gyro_det</a> = 0.006</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gyroscope noise standard deviation figure [ <img class="formulaInl" alt="$rad/s$" src="form_22.png"/>], which is used to control how much the detector should trusts the gyroscope data.  <a href="#ga779a972b079accc690d64bcd7bef3c91"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga9e9b826ff87a8e0e4400661c27988682">detector_Window_size</a> = 3</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The data window size used in the detector (OBS! Must be an odd number.).  <a href="#ga9e9b826ff87a8e0e4400661c27988682"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#ga34d28cf12521d9706da4ddfca54106bf">detector_threshold</a> = 50000</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Threshold used in the detector.  <a href="#ga34d28cf12521d9706da4ddfca54106bf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gabd51dc1d49060099533807a22acc61d4">zupt</a> = false</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Flag that is set to true if a zero-velocity update should be done.  <a href="#gabd51dc1d49060099533807a22acc61d4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nav__eq.html#gae420c23e5d1fdf5b157535212ddeba9e">Test_statistics</a> = 0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Variable holding the test statistics for the generalized likelihood ratio test, i.e., the zero-velocity detector.  <a href="#gae420c23e5d1fdf5b157535212ddeba9e"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>This group contain the filtering algorithms written for OpenShoe. That is, the ZUPT aided INS and calibration algorithms </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga8add91659e5cb9c98d3a32c44269f034"></a><!-- doxytag: member="nav_eq.h::absf" ref="ga8add91659e5cb9c98d3a32c44269f034" args="(a)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define absf</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a</td><td>)</td>
          <td>&#160;&#160;&#160;(a&gt;0 ? a:-a)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Absolute value of a floating point variable. </p>

</div>
</div>
<a class="anchor" id="ga831d1c30dc8456f94b32e61f65409f4d"></a><!-- doxytag: member="nav_eq.h::ACC_CALIBRATION_ILLCONDITIONED" ref="ga831d1c30dc8456f94b32e61f65409f4d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ACC_CALIBRATION_ILLCONDITIONED&#160;&#160;&#160;3</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Value returned in the error message if the orientations used in the accelerometer calibration were poorly chosen. </p>

</div>
</div>
<a class="anchor" id="gad356bf235d99e4983077623c35c068c0"></a><!-- doxytag: member="nav_eq.h::ACC_STATIONARITY_ERROR" ref="gad356bf235d99e4983077623c35c068c0" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ACC_STATIONARITY_ERROR&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Value returned in the error message if the IMU was not stationary during the accelerometer calibration. </p>

</div>
</div>
<a class="anchor" id="ga2543e63d374d215bd7e64b4afb54287f"></a><!-- doxytag: member="nav_eq.h::MATRIX_INVERSION_ERROR" ref="ga2543e63d374d215bd7e64b4afb54287f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MATRIX_INVERSION_ERROR&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Value returned in the error message if an error occurred in the matrix inversion. </p>

</div>
</div>
<a class="anchor" id="gac33a980808c64969262d91fa090eae7d"></a><!-- doxytag: member="nav_eq.h::MAX_ORIENTATIONS" ref="gac33a980808c64969262d91fa090eae7d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MAX_ORIENTATIONS&#160;&#160;&#160;12</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Maximum numbers of orientations that can be used in the accelerometer calibration. </p>

</div>
</div>
<a class="anchor" id="ga4a21daf1ec76403dafe6b89d46fedbce"></a><!-- doxytag: member="nav_eq.h::MIN_ORIENTATIONS" ref="ga4a21daf1ec76403dafe6b89d46fedbce" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MIN_ORIENTATIONS&#160;&#160;&#160;3</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Minimum numbers of orientations that can be used in the accelerometer calibration. </p>

</div>
</div>
<a class="anchor" id="gae34482207df685c69af65539f47656fa"></a><!-- doxytag: member="nav_eq.h::NUMBER_OF_ORIENTATIONS_TO_LARGE" ref="gae34482207df685c69af65539f47656fa" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define NUMBER_OF_ORIENTATIONS_TO_LARGE&#160;&#160;&#160;4</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Value returned in the error message if the number of orientations specified for the accelerometer calibration is to large. It has been changed to 12. </p>

</div>
</div>
<a class="anchor" id="gad656aa8d45ef9064bf607734a3af16a1"></a><!-- doxytag: member="nav_eq.h::NUMBER_OF_ORIENTATIONS_TO_SMALL" ref="gad656aa8d45ef9064bf607734a3af16a1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define NUMBER_OF_ORIENTATIONS_TO_SMALL&#160;&#160;&#160;5</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Value returned in the error message if the number of orientations specified for the accelerometer calibration is to few. It has been changed to 3. </p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gabb3f28a44a35898c77d789734914c4c2"></a><!-- doxytag: member="nav_eq.h::calibrate_accelerometers" ref="gabb3f28a44a35898c77d789734914c4c2" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void calibrate_accelerometers </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Function for calibrating the accelerometer biases. </p>
<p>This function is used to calibrate the biases of the accelerometers in the IMU and requires the users to place the IMU into at least three different orientations. The calibration method is based upon the calibration algorithm described in the paper <a href="https://eeweb01.ee.kth.se/upload/publications/reports/2010/IR-EE-SB_2010_046.pdf">Calibration of the Accelerometer Triad of an Inertial Measurement Unit, Maximum Likelihood Estimation and Cramer-Rao Bound</a>, but does only calibrate the accelerometer bias.</p>
<p>Before the calibration is started the flags <em>new_orientation_flag</em> and <em>acc_calibration_successful_flag</em> should be set to false. Then the function should called every time new IMU-data have been read from the IMU and as long as the new flags <em>new_orientation_flag</em> and <em>acc_calibration_successful_flag</em> are false. When the flag <em>new_orientation_flag</em> becomes true a message should be sent to the user, which then should place the IMU in a new orientation and reset the flag. When the flag <em>acc_calibration_successful_flag</em> becomes true the calibration is finished and the accelerometer calibration parameters have been written into the memory of the IMU.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>The function can return one error and one warning message that are stored in the variable #error_vec. The error message may be sent if the was no stationary during one of the calibration phases and new accelerometer data most be recorded with the IMU in the same orientation. A warning message may be sent if the orientations the IMU was placed in may have caused a poor estimate of the accelerometer biases.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">error_vec</td><td>A variable that is set non zero value of an error/warning has occurred during the </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">acc_calibration_successful_flag</td><td>A flag that should be false when calibration is started and that becomes true when the calibration is finished. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">new_orientation_flag</td><td>A flag that should be false when calibration is started and that becomes true when IMU should be placed in a new orientation. When the IMU has been placed in a new orientation it should be set to false. execution of the function. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">accelerations_in</td><td>The from the IMU latest read acceleration data. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga8812381ada5c2786a10e378e4ca34377"></a><!-- doxytag: member="nav_eq.h::correct_navigation_states" ref="ga8812381ada5c2786a10e378e4ca34377" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void correct_navigation_states </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Function for correcting the navigation states given a zero-velocity detection. </p>
<p>When called this function takes the velocity estimate of the navigation system and treat it as an observation of the current velocity error of the system. The errors in all navigation states (position, velocity, and attitude) are then estimated by multiplying the "velocity error" with the Kalman gain. The estimated errors in the navigation states are then used to correct the navigation states.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">position</td><td>The position estimate of the navigation system. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">velocity</td><td>The velocity estimate of the navigation system. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">quaternions</td><td>The orientation estimate of the navigation system. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">Rb2t</td><td>The vector representation of the body to navigation coordinate system rotation matrix estimate. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">kalman_gain</td><td>The vector representation of the Kalman filter gain matrix. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga272f4012a72ac416888be28bff0236e6"></a><!-- doxytag: member="nav_eq.h::estimate_accelerometer_biases" ref="ga272f4012a72ac416888be28bff0236e6" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void estimate_accelerometer_biases </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Function that estimates the accelerometer biases given a matrix of the mean of the measured acceleration at different orientations. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">max_v</td><td>Largest value of the input vector. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">index</td><td>Index of the vector element holding the largest value. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">arg_vec</td><td>The input vector. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga75c4a936b2db01f930ba89babb822f69"></a><!-- doxytag: member="nav_eq.h::gain_matrix" ref="ga75c4a936b2db01f930ba89babb822f69" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gain_matrix </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Function for calculating the Kalman filter gain matrix. </p>
<p>When called the function calculates the Kalman filter gain and store it in the vector <em>kalman_gain</em>. To calculate the gain the function uses the Kalman filter covariance and the pseudo velocity measurement noise standard deviation.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">kalman_gain</td><td>The vector representation of the Kalman filter gain matrix. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cov_vector</td><td>The vector representation of the Kalman filter covariance matrix. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sigma_velocity</td><td>The standard deviation of the pseudo velocity measurement error (Note: This parameters enters the function through a sub-function.). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga8b0f8dc8c2ae1ff3f5e4f27284cf8e77"></a><!-- doxytag: member="nav_eq.h::initialize_navigation_algorithm" ref="ga8b0f8dc8c2ae1ff3f5e4f27284cf8e77" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void initialize_navigation_algorithm </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Function for initializing the navigation algorithm. </p>
<p>This function initializes the navigation algorithm and should during the initialization of the navigation system be called every time new IMU-data have been read from the IMU. Before the initialization is started the flag <em>initialize_flag</em> should be set to true, and the counter <em>initialize_sample_ctr</em> to zero. The initialization is finished when the flag <em>initialize_flag</em> becomes false.</p>
<p>The initialization function first runs an initial alignment of the navigation system, where the roll and pitch are estimated from the average of the accelerometer readings. Then, the function sets the initial navigation states (position, velocity, and quaternions) and the initial Kalman filter covariance.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>The navigation system most be stationary during the initialization, and the number of samples used in the initial alignment most be larger than the length of the zero-velocity detector window.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">position</td><td>The position estimate of the navigation system. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">velocity</td><td>The velocity estimate of the navigation system. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">quaternions</td><td>The orientation estimate of the navigation system. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">cov_vector</td><td>The vector representation of the Kalman filter covariance matrix. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">initialize_flag</td><td>A flag that should be set to true when initialization is started and that becomes false when the initialization is finished. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">nr_of_inital_alignment_samples</td><td>The number of samples used in the initial alignment. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">initial_heading</td><td>The initial heading of the navigation system. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">initial_pos</td><td>The initial position of the navigation system. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sigma_initial_position</td><td>The standard deviations of the uncertainties in the initial position. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sigma_initial_velocity</td><td>The standard deviations of the uncertainties in the initial velocity. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sigma_initial_attitude</td><td>The standard deviations of the uncertainties in the initial attitude. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaa1673f6cf928e97c6372c56eddb4cc72"></a><!-- doxytag: member="nav_eq.h::measurement_update" ref="gaa1673f6cf928e97c6372c56eddb4cc72" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void measurement_update </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Function for doing a measurement update of the Kalman filter covariance. </p>
<p>When called the function does a measurement update of the Kalman filter state covariance matrix stored in the vector <em>cov_vector</em>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">cov_vector</td><td>The vector representation of the Kalman filter covariance matrix. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">kalman_gain</td><td>The vector representation of the Kalman filter gain matrix. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga9169808fbcb9f517deb908960a69ca7a"></a><!-- doxytag: member="nav_eq.h::strapdown_mechanisation_equations" ref="ga9169808fbcb9f517deb908960a69ca7a" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void strapdown_mechanisation_equations </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Function for doing a time update of the mechanized navigation equations. </p>
<p>When called the function does a time update of the mechanized inertial navigation system equations. That is, first the quaternions stored in <em>quaternions</em> is updated using the angular rate measurements in <em>angular_rates_out</em>. Then the position and velocity state vectors <em>position</em> and <em>velocity</em> are updated using the acceleration measurements in <em>accelerations_out</em>. The function also updates the ''aiding'' vector <em>Rb2t</em> (body to navigation coordinate system rotation matrix) which is used in the Kalman filter.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>This is a rudimentary mechanization of the inertial navigation equations which only is suitable for use with systems that uses low-cost/low-performance inertial sensors and where only short periods of free inertial navigation is expected.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">position</td><td>The position estimate of the navigation system. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">velocity</td><td>The velocity estimate of the navigation system. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">quaternions</td><td>The orientation estimate of the navigation system. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">Rb2t</td><td>The body to navigation coordinate system rotation matrix estimate. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">accelerations_out</td><td>The acceleration measurements used in the update of the inertial navigation system equations. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">angular_rates_out</td><td>The angular rate measurements used in the update of the inertial navigation system equations. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dt</td><td>The sampling period of the system. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">g</td><td>The magnitude of the local gravity vector. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gac80ad2aa648edb47edb8f62883cb2a7d"></a><!-- doxytag: member="nav_eq.h::time_up_data" ref="gac80ad2aa648edb47edb8f62883cb2a7d" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void time_up_data </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Function for doing a time update of the Kalman filter state covariance. </p>
<p>When called the function does a time update of the Kalman filter state covariance matrix stored in the vector <em>cov_vector</em>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">cov_vector</td><td>The vector representation of the Kalman filter covariance matrix. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dt</td><td>The sampling period of the system. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sigma_acceleration</td><td>The standard deviation of the accelerometer process noise. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sigma_gyroscope</td><td>The standard deviation of the gyroscope process noise. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">accelerations_out</td><td>The acceleration measurements used in the update of the inertial navigation system equations. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">Rb2t</td><td>The vector current body to navigation coordinate system rotation matrix estimate. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaae1bbd924940610e1709300d40ca5a0f"></a><!-- doxytag: member="nav_eq.h::update_imu_data_buffers" ref="gaae1bbd924940610e1709300d40ca5a0f" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void update_imu_data_buffers </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Function that updates the IMU data buffers with the latest values read from the IMU, and writes the IMU data to that should be process at the current iteration to the processing variables. </p>
<p>The function updates the IMU data buffers <em>acc_buffer_x_axis</em>, <em>acc_buffer_y_axis</em>, <em>acc_buffer_z_axis</em>, <em>gyro_buffer_x_axis</em>, <em>gyro_buffer_y_axis</em>, <em>gyro_buffer_z_axis</em> with the values stored in the vectors <em>accelerations_in</em> and <em>angular_rates_in</em>. The function also updates the vectors <em>accelerations_out</em> and <em>angular_rates_out</em>. The data stored in these vectors is the data processed in the next iteration of the navigation algorithm.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>This function should be called after data have been read from the IMU through the SPI interface and before the navigation algorithm is processed.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">accelerations_out</td><td>The acceleration data that is to be used in the next iteration of the navigation algorithm. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">angular_rates_out</td><td>The angular rate data that is to be used in the next iteration of the navigation algorithm. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">accelerations_in</td><td>The from the IMU latest read acceleration data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">angular_rates_in</td><td>The from the IMU latest read angular rate data. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaf0b7424f50d37755b6b0736808082299"></a><!-- doxytag: member="nav_eq.h::ZUPT_detector" ref="gaf0b7424f50d37755b6b0736808082299" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ZUPT_detector </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Function for detecting when the system has zero-velocity. </p>
<p>When called this function takes the acceleration and angular rate measurements stored in the IMU data buffers and runs a generalized likelihood ratio test to determine if the navigation system is stationary or moving. More information about the detector and it characteristics can be found in following papers:</p>
<ul>
<li><a href="https://eeweb01.ee.kth.se/upload/publications/reports/2010/IR-EE-SB_2010_038.pdf">Zero-Velocity Detection -- An Algorithm Evaluation</a> </li>
<li><a href="https://eeweb01.ee.kth.se/upload/publications/reports/2010/IR-EE-SB_2010_043.pdf">Evaluation of Zero-Velocity Detectors for Foot-Mounted Inertial Navigation Systems</a></li>
</ul>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">zupt</td><td>The zero-velocity detection flag </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">detector_Window_size</td><td>The window size of the zero-velocity detector. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">detector_threshold</td><td>The threshold used in the detector. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sigma_acc_det</td><td>The standard deviation figure used to control the importance of the accelerometer measurements in the detection algorithm. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sigma_gyro_det</td><td>The standard deviation figure used to control the importance of the gyroscope measurements in the detection algorithm. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">g</td><td>The magnitude of the local gravity vector. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga0b4ee34435eebb426eb367120ee79d72"></a><!-- doxytag: member="nav_eq.h::zupt_update" ref="ga0b4ee34435eebb426eb367120ee79d72" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void zupt_update </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Wrapper function that checks if a zero-velocity update should be done, and then calls all navigation algorithm functions that should be executed during a zero-velocity update. </p>
<p>Wrapper function that checks if a zero-velocity update should be done, and then calls all navigation algorithm functions that should be executed during a zero-velocity update. The function first calls <em>ZUPT_detector</em>. If then flag <em>zupt</em> is set to true, it also calls the following functions:</p>
<ul>
<li>gain_matrix </li>
<li>correct_navigation_states </li>
<li>measurement_update </li>
</ul>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="gaa3b35b0b909a9a4b40d82658fab54349"></a><!-- doxytag: member="nav_eq.c::acc_calibration_finished_flag" ref="gaa3b35b0b909a9a4b40d82658fab54349" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Bool <a class="el" href="group__nav__eq.html#gaa3b35b0b909a9a4b40d82658fab54349">acc_calibration_finished_flag</a> = false</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Flag that is set to true when the calibration is finished. Must be set to false before the calibration is started. </p>

</div>
</div>
<a class="anchor" id="gad5049be4d6ed3b9f92063c6ca6413b46"></a><!-- doxytag: member="nav_eq.c::acceleration_variance_threshold" ref="gad5049be4d6ed3b9f92063c6ca6413b46" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a> <a class="el" href="group__nav__eq.html#gad5049be4d6ed3b9f92063c6ca6413b46">acceleration_variance_threshold</a> = 0.002</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Threshold used to check that accelerometers were stationary during the calibration [ <img class="formulaInl" alt="$(m/s^2)^2$" src="form_18.png"/>]. </p>

</div>
</div>
<a class="anchor" id="gaf92cab44915b7d9faaf5aeadb328bae6"></a><!-- doxytag: member="nav_eq.c::accelerations_in" ref="gaf92cab44915b7d9faaf5aeadb328bae6" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a> <a class="el" href="group__nav__eq.html#gaf92cab44915b7d9faaf5aeadb328bae6">accelerations_in</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Accelerations read from the IMU [ <img class="formulaInl" alt="$m/s^2$" src="form_17.png"/>]. These are written into the IMU data buffer. </p>

</div>
</div>
<a class="anchor" id="ga0e1577a397995052e34d61ddbf578956"></a><!-- doxytag: member="nav_eq.c::accelerations_out" ref="ga0e1577a397995052e34d61ddbf578956" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a> <a class="el" href="group__nav__eq.html#ga0e1577a397995052e34d61ddbf578956">accelerations_out</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Accelerations outputted from the IMU data buffer [ <img class="formulaInl" alt="$m/s^2$" src="form_17.png"/>]. </p>

</div>
</div>
<a class="anchor" id="ga1089eea940f41eff26a6cba1172089e9"></a><!-- doxytag: member="nav_eq.c::accelerometer_biases" ref="ga1089eea940f41eff26a6cba1172089e9" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a> <a class="el" href="group__nav__eq.html#ga1089eea940f41eff26a6cba1172089e9">accelerometer_biases</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Accelerometer biases (x,y,z-axis) [ <img class="formulaInl" alt="$m/s^2$" src="form_17.png"/>]. </p>

</div>
</div>
<a class="anchor" id="ga0387cded24d9bdfa34c78dc27bef01e8"></a><!-- doxytag: member="nav_eq.c::altitude" ref="ga0387cded24d9bdfa34c78dc27bef01e8" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a> <a class="el" href="group__nav__eq.html#ga0387cded24d9bdfa34c78dc27bef01e8">altitude</a> = 920</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Rough altitude of the system [ <img class="formulaInl" alt="$m$" src="form_20.png"/>]. (Used to calculate the magnitude of the gravity vector) </p>

</div>
</div>
<a class="anchor" id="ga8cac4b2812dcb492989d7122c5eb0bfb"></a><!-- doxytag: member="nav_eq.c::angular_rates_in" ref="ga8cac4b2812dcb492989d7122c5eb0bfb" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a> <a class="el" href="group__nav__eq.html#ga8cac4b2812dcb492989d7122c5eb0bfb">angular_rates_in</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Angular rates read from the IMU [ <img class="formulaInl" alt="$rad/s$" src="form_22.png"/>]. These are written into the IMU data buffer. </p>

</div>
</div>
<a class="anchor" id="gabdb2113f7c6caefe1b25826c1f7c8324"></a><!-- doxytag: member="nav_eq.c::angular_rates_out" ref="gabdb2113f7c6caefe1b25826c1f7c8324" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a> <a class="el" href="group__nav__eq.html#gabdb2113f7c6caefe1b25826c1f7c8324">angular_rates_out</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Angular rates outputted from the IMU data buffer [ <img class="formulaInl" alt="$rad/s$" src="form_22.png"/>]. </p>

</div>
</div>
<a class="anchor" id="ga74c09cdfc5b901e7f842dbe42ed8f4f4"></a><!-- doxytag: member="nav_eq.c::cov_vector" ref="ga74c09cdfc5b901e7f842dbe42ed8f4f4" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a0f4089eb3ad75e0675d7f7d3914fddeb">mat9sym</a> <a class="el" href="group__nav__eq.html#ga74c09cdfc5b901e7f842dbe42ed8f4f4">cov_vector</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Vector representation of the Kalman filter covariance matrix. </p>

</div>
</div>
<a class="anchor" id="ga34d28cf12521d9706da4ddfca54106bf"></a><!-- doxytag: member="nav_eq.c::detector_threshold" ref="ga34d28cf12521d9706da4ddfca54106bf" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a> <a class="el" href="group__nav__eq.html#ga34d28cf12521d9706da4ddfca54106bf">detector_threshold</a> = 50000</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Threshold used in the detector. </p>

</div>
</div>
<a class="anchor" id="ga9e9b826ff87a8e0e4400661c27988682"></a><!-- doxytag: member="nav_eq.c::detector_Window_size" ref="ga9e9b826ff87a8e0e4400661c27988682" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">volatile uint8_t <a class="el" href="group__nav__eq.html#ga9e9b826ff87a8e0e4400661c27988682">detector_Window_size</a> = 3</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The data window size used in the detector (OBS! Must be an odd number.). </p>

</div>
</div>
<a class="anchor" id="gae7e97f885bb0d70931c5c70ad200880d"></a><!-- doxytag: member="nav_eq.c::dt" ref="gae7e97f885bb0d70931c5c70ad200880d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a> <a class="el" href="group__nav__eq.html#gae7e97f885bb0d70931c5c70ad200880d">dt</a> = 0.001220703125000</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sampling period [ <img class="formulaInl" alt="$s$" src="form_21.png"/>]. </p>

</div>
</div>
<a class="anchor" id="ga3f996476795917a4b1ace8c6c5e4b28a"></a><!-- doxytag: member="nav_eq.c::error_signal" ref="ga3f996476795917a4b1ace8c6c5e4b28a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t <a class="el" href="group__nav__eq.html#ga3f996476795917a4b1ace8c6c5e4b28a">error_signal</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Error signaling vector. If zero no error has occurred. </p>

</div>
</div>
<a class="anchor" id="gac7d75e5db7af21a75e50ad6437827947"></a><!-- doxytag: member="nav_eq.c::g" ref="gac7d75e5db7af21a75e50ad6437827947" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a> <a class="el" href="group__nav__eq.html#gac7d75e5db7af21a75e50ad6437827947">g</a> = 9.782940329221166</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Magnitude of the local gravity acceleration [ <img class="formulaInl" alt="$m/s^2$" src="form_17.png"/>]. </p>

</div>
</div>
<a class="anchor" id="gaf18deb1376fcc761f2ec2d947cf004e7"></a><!-- doxytag: member="nav_eq.c::initial_heading" ref="gaf18deb1376fcc761f2ec2d947cf004e7" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a> <a class="el" href="group__nav__eq.html#gaf18deb1376fcc761f2ec2d947cf004e7">initial_heading</a> = 0</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initial heading [ <img class="formulaInl" alt="$rad$" src="form_23.png"/>]. </p>

</div>
</div>
<a class="anchor" id="ga7cd4f9c9472377e6ef5935727ada7109"></a><!-- doxytag: member="nav_eq.c::initial_pos" ref="ga7cd4f9c9472377e6ef5935727ada7109" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a> <a class="el" href="group__nav__eq.html#ga7cd4f9c9472377e6ef5935727ada7109">initial_pos</a> = {0, 0, 0}</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initial position (North, East, Down) [ <img class="formulaInl" alt="$m$" src="form_20.png"/>]. </p>

</div>
</div>
<a class="anchor" id="gac64a954fe1bf13df62e1e96920a36035"></a><!-- doxytag: member="nav_eq.c::initialize_flag" ref="gac64a954fe1bf13df62e1e96920a36035" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Bool <a class="el" href="group__nav__eq.html#gac64a954fe1bf13df62e1e96920a36035">initialize_flag</a> = true</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>A flag that should be set to true when initialization is started and that becomes false when the initialization is finished. </p>

</div>
</div>
<a class="anchor" id="gac1df051c6f380aa8d1598b15ee9e6eca"></a><!-- doxytag: member="nav_eq.c::kalman_gain" ref="gac1df051c6f380aa8d1598b15ee9e6eca" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#af1d09a15760e21f5de26f0839f1b6c62">mat9by3</a> <a class="el" href="group__nav__eq.html#gac1df051c6f380aa8d1598b15ee9e6eca">kalman_gain</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Vector representation of the Kalman filter gain matrix. </p>

</div>
</div>
<a class="anchor" id="ga98eaf96c6c207db4b40273a599149ebe"></a><!-- doxytag: member="nav_eq.c::latitude" ref="ga98eaf96c6c207db4b40273a599149ebe" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a> <a class="el" href="group__nav__eq.html#ga98eaf96c6c207db4b40273a599149ebe">latitude</a> = 13</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Rough latitude of the system [ <img class="formulaInl" alt="$degrees$" src="form_19.png"/>]. (Used to calculate the magnitude of the gravity vector) </p>

</div>
</div>
<a class="anchor" id="ga9340627920ea2445fe1469547bc64eae"></a><!-- doxytag: member="nav_eq.c::new_orientation_flag" ref="ga9340627920ea2445fe1469547bc64eae" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Bool <a class="el" href="group__nav__eq.html#ga9340627920ea2445fe1469547bc64eae">new_orientation_flag</a> = false</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Flag that is set to true when the IMU should be place in a new orientation. Should be set to false when the calibration procedure is started, and when the IMU has been placed in a new orientation by the user. </p>

</div>
</div>
<a class="anchor" id="ga642a3ad33a0242f4e12fe46a13b0303f"></a><!-- doxytag: member="nav_eq.c::nr_of_calibration_orientations" ref="ga642a3ad33a0242f4e12fe46a13b0303f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t <a class="el" href="group__nav__eq.html#ga642a3ad33a0242f4e12fe46a13b0303f">nr_of_calibration_orientations</a> = 6</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Number of orientations used in the accelerometer calibration procedure. OBS! Most be at least 3 and less than 13. </p>

</div>
</div>
<a class="anchor" id="gab9d05ce5927a225127eff6993856da19"></a><!-- doxytag: member="nav_eq.c::nr_of_calibration_samples" ref="gab9d05ce5927a225127eff6993856da19" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t <a class="el" href="group__nav__eq.html#gab9d05ce5927a225127eff6993856da19">nr_of_calibration_samples</a> = 800</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Number of samples used at each orientation in the calibration procedure. </p>

</div>
</div>
<a class="anchor" id="gaf3c89a8b1365434986dc0314c1c541cf"></a><!-- doxytag: member="nav_eq.c::nr_of_inital_alignment_samples" ref="gaf3c89a8b1365434986dc0314c1c541cf" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t <a class="el" href="group__nav__eq.html#gaf3c89a8b1365434986dc0314c1c541cf">nr_of_inital_alignment_samples</a> = 16</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Number of samples used in the initial alignment. </p>

</div>
</div>
<a class="anchor" id="ga2807b9fb4b79e01dfde022b613d2575f"></a><!-- doxytag: member="nav_eq.c::position" ref="ga2807b9fb4b79e01dfde022b613d2575f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a> <a class="el" href="group__nav__eq.html#ga2807b9fb4b79e01dfde022b613d2575f">position</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Position estimate (North,East,Down) [ <img class="formulaInl" alt="$m$" src="form_20.png"/>]. </p>

</div>
</div>
<a class="anchor" id="ga059b83d370e7e6a5e9728a8f91943051"></a><!-- doxytag: member="nav_eq.c::quaternions" ref="ga059b83d370e7e6a5e9728a8f91943051" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#ad9a64f455fa02affaba6740746aae7b2">quat_vec</a> <a class="el" href="group__nav__eq.html#ga059b83d370e7e6a5e9728a8f91943051">quaternions</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Attitude (quaternions) estimate. </p>

</div>
</div>
<a class="anchor" id="ga42753cbc9ae76483da3cbc331a011586"></a><!-- doxytag: member="nav_eq.c::Rb2t" ref="ga42753cbc9ae76483da3cbc331a011586" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#ab7675278cb555aa98b43c97694753329">mat3</a> <a class="el" href="group__nav__eq.html#ga42753cbc9ae76483da3cbc331a011586">Rb2t</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Rotation matrix used as an "aiding" variable in the filter algorithm. Holds the same information as the quaternions. </p>

</div>
</div>
<a class="anchor" id="ga519e1c68258a371960249e09c24e9943"></a><!-- doxytag: member="nav_eq.c::sigma_acc_det" ref="ga519e1c68258a371960249e09c24e9943" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a> <a class="el" href="group__nav__eq.html#ga519e1c68258a371960249e09c24e9943">sigma_acc_det</a> = 0.035</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Accelerometer noise standard deviation figure [ <img class="formulaInl" alt="$m/s^2$" src="form_17.png"/>], which is used to control how much the detector should trusts the accelerometer data. </p>

</div>
</div>
<a class="anchor" id="ga5add0877d1169e9e1d4dd227c1bcc83d"></a><!-- doxytag: member="nav_eq.c::sigma_acceleration" ref="ga5add0877d1169e9e1d4dd227c1bcc83d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a> <a class="el" href="group__nav__eq.html#ga5add0877d1169e9e1d4dd227c1bcc83d">sigma_acceleration</a> = 0.7</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Accelerometer process noise standard deviation [ <img class="formulaInl" alt="$m/s^2$" src="form_17.png"/>]. </p>

</div>
</div>
<a class="anchor" id="ga779a972b079accc690d64bcd7bef3c91"></a><!-- doxytag: member="nav_eq.c::sigma_gyro_det" ref="ga779a972b079accc690d64bcd7bef3c91" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a> <a class="el" href="group__nav__eq.html#ga779a972b079accc690d64bcd7bef3c91">sigma_gyro_det</a> = 0.006</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Gyroscope noise standard deviation figure [ <img class="formulaInl" alt="$rad/s$" src="form_22.png"/>], which is used to control how much the detector should trusts the gyroscope data. </p>

</div>
</div>
<a class="anchor" id="gab6e7cd8a13de230fbcef8ad4e8001eb6"></a><!-- doxytag: member="nav_eq.c::sigma_gyroscope" ref="gab6e7cd8a13de230fbcef8ad4e8001eb6" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a> <a class="el" href="group__nav__eq.html#gab6e7cd8a13de230fbcef8ad4e8001eb6">sigma_gyroscope</a> = 0.005235987755983</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Gyroscope process noise standard deviation [ <img class="formulaInl" alt="$rad/s$" src="form_22.png"/>]. </p>

</div>
</div>
<a class="anchor" id="gaad9757cf97cfd938818e7785a3beafe1"></a><!-- doxytag: member="nav_eq.c::sigma_initial_attitude" ref="gaad9757cf97cfd938818e7785a3beafe1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a> <a class="el" href="group__nav__eq.html#gaad9757cf97cfd938818e7785a3beafe1">sigma_initial_attitude</a> = {0.00174,0.00174,0.00174}</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Standard deviations in the initial attitude uncertainties [ <img class="formulaInl" alt="$rad$" src="form_23.png"/>]. </p>

</div>
</div>
<a class="anchor" id="ga0ace968269836475a5c59c16280d1bf1"></a><!-- doxytag: member="nav_eq.c::sigma_initial_position" ref="ga0ace968269836475a5c59c16280d1bf1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a> <a class="el" href="group__nav__eq.html#ga0ace968269836475a5c59c16280d1bf1">sigma_initial_position</a> = {0.00001,0.00001,0.00001}</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Standard deviations in the initial position uncertainties [ <img class="formulaInl" alt="$m$" src="form_20.png"/>]. </p>

</div>
</div>
<a class="anchor" id="ga5abe69320e5702cb7f4b79abb9bcf297"></a><!-- doxytag: member="nav_eq.c::sigma_initial_velocity" ref="ga5abe69320e5702cb7f4b79abb9bcf297" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a> <a class="el" href="group__nav__eq.html#ga5abe69320e5702cb7f4b79abb9bcf297">sigma_initial_velocity</a> = {0.01,0.01,0.01}</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Standard deviations in the initial velocity uncertainties [ <img class="formulaInl" alt="$m/s$" src="form_24.png"/>]. </p>

</div>
</div>
<a class="anchor" id="gae79b582d3d0132b84117242e1f6103f3"></a><!-- doxytag: member="nav_eq.c::sigma_velocity" ref="gae79b582d3d0132b84117242e1f6103f3" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a> <a class="el" href="group__nav__eq.html#gae79b582d3d0132b84117242e1f6103f3">sigma_velocity</a> = {0.1,0.1,0.1}</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Pseudo zero-velocity measurement noise standard deviations (north, east, down) [ <img class="formulaInl" alt="$m/s$" src="form_24.png"/>]. </p>

</div>
</div>
<a class="anchor" id="gae420c23e5d1fdf5b157535212ddeba9e"></a><!-- doxytag: member="nav_eq.c::Test_statistics" ref="gae420c23e5d1fdf5b157535212ddeba9e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a> <a class="el" href="group__nav__eq.html#gae420c23e5d1fdf5b157535212ddeba9e">Test_statistics</a> = 0</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Variable holding the test statistics for the generalized likelihood ratio test, i.e., the zero-velocity detector. </p>

</div>
</div>
<a class="anchor" id="ga589efe00d8bd4e8a69613f98390a04c7"></a><!-- doxytag: member="nav_eq.c::velocity" ref="ga589efe00d8bd4e8a69613f98390a04c7" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a> <a class="el" href="group__nav__eq.html#ga589efe00d8bd4e8a69613f98390a04c7">velocity</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Velocity estimate (North,East,Down) [ <img class="formulaInl" alt="$m/s$" src="form_24.png"/>]. </p>

</div>
</div>
<a class="anchor" id="gabd51dc1d49060099533807a22acc61d4"></a><!-- doxytag: member="nav_eq.c::zupt" ref="gabd51dc1d49060099533807a22acc61d4" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="group__nav__eq.html#gabd51dc1d49060099533807a22acc61d4">zupt</a> = false</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Flag that is set to true if a zero-velocity update should be done. </p>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Dec 20 2011 12:12:37 for OpenShoe by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
